﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Koonsoft.HYCRM.BLL;

public partial class LoginCondition_MonthLoginCondition : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DateTime dtStart = new DateTime();

        try
        {
            dtStart = Convert.ToDateTime(Convert.ToDateTime(TextBox1.Text.Trim()).ToString("yyyy-MM-1"));
        }
        catch (Exception)
        {
            AlertMsg("时间格式错误");

            return;
        }

        GridView1.DataSource = new LoginConditionBLL().GetEmplyeeLoginCondition(dtStart,dtStart.AddMonths(1).AddDays(-1), -1);
        GridView1.DataBind();
    }

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "info":
                Response.Redirect(string.Format("~/LoginCondition/UserMonthLoginCondition.aspx?LoginName={0}&Time={1}", e.CommandArgument,TextBox1.Text.Trim()));
                break;
        }
    }
}